import http from '@/api/api.ts'
import type { ILogin, IRegister } from './type';
import { IResponse } from '@/declare/request';
import request from '@/utils/reqest.ts';

/**
 * @description: 用户登录
 * @params {ILogin} params
 * @return {Promise}
 */
// export const Login = (params: ILogin): Promise<IResponse> => {
//     return http.post('', params).then(res => res.data);
// };
/** 
 * @description:用户注册
 * @params {IRegister}params
 * @return {Promise}
  */
export const Register = (params: IRegister): Promise<IResponse> => {
    return http.post('', params).then(res => res.data);
}

export const Login=(data: ILogin): Promise<IResponse> => {
    console.log("data",data)
    return request.post('/user/login', data).then(res => res.data);
};